package com.example.dell.intelligentagriculture;



import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.RelativeLayout;

import java.util.Timer;
import java.util.TimerTask;

public class WelcomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        RelativeLayout rl = findViewById(R.id.rl);
        Timer timer = new Timer();
        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {
                Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class);
                startActivity(intent);
            }
        };
        timer.schedule(timerTask, 3000);
        Animation animation = AnimationUtils.loadAnimation(this, R.anim.login);
        rl.setAnimation(animation);
        animation.setFillAfter(true);
    }


    @Override
    protected void onStop() {
        super.onStop();
        finish();
    }
}

